<?php
/* @var $this CategoryController */
/* @var $model Category */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'category-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sort'); ?>
		<?php echo $form->textField($model,'sort'); ?>
		<?php echo $form->error($model,'sort'); ?>
	</div>
  
  <div class="row">
    <?php echo $form->labelEx($model,'parentID'); ?>
    <?php echo $form->dropdownList($model,'parentID', Category::model()->getCategories(), array('prompt' => Yii::t('default', 'Chọn thể loại cha')))?>
  </div>

	<div class="row">
     <?php echo $form->labelEx($model,'enabled'); ?>
     <?php echo $form->radioButtonList($model, 'enabled', array('1' => Yii::t('default', 'Có'), '0' => Yii::t('default', 'Không')), array('separator'=>'', 'template'=>' {input} {label} ')); ?>
  </div>


	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->